<?php
/**
 * SocialEnginePro
 *
 * @category   Application_Extensions
 * @package    tv
 * @author     Azim
 */

/**
 * @category   Application_Extensions
 * @package    tv
 */
class Tv_Widget_LanguageController extends Engine_Content_Widget_Abstract
{
  
  public function indexAction()
  {
        $table = Engine_Api::_()->getDbtable('tvs', 'tv');


        $select = $table->getListTv('language');

        $list = array();
        
        foreach ($select->toArray() as $key => $value) {
            $list[$value['language']] = Zend_Locale::getTranslation($value['language'], 'language', $value['language']).'('.$value['count'].')';
        }
        
        $this->view->languages = $list;
        
        if (count($list)<= 0) {
            return $this->setNoRender();
        }
  }
}